package com.aop.jdk.aop;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
/**
 * Created by SliverZhang on 2018/1/14.
 */
public class ProxyHandleImpl implements InvocationHandler{
    private Eat eat;
    public ProxyHandleImpl(Eat eat) {
        this.eat = eat;
    }
    public ProxyHandleImpl() {
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("before ...");
        Object object =  method.invoke(eat,args);
        System.out.println("after  ..."+object);
        return object;
    }
}
